package com.chem.lems.constans;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.core.env.Environment;

import javax.annotation.PostConstruct;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Calendar;

public class BackupConstants {


    /**
     * 备份根目录名称
     */
    public static final String SFOLDER_NAME = "backfolder";
    /**
     * 备份目录名称
     */
    public static final String BACKUP_FOLDER_NAME = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime());
    /**
     * 备份目录
     */
    public static final String BACKUP_FOLDER = SFOLDER_NAME + File.separator + BACKUP_FOLDER_NAME + File.separator;
    /**
     * 还原目录，默认就是备份目录
     */
    public static final String RESTORE_FOLDER = BACKUP_FOLDER;
    /**
     * SQL拓展名
     */
    public static final String SQL_EXT = ".sql";

    /**
     * 目标备份数据库信息
     */
    public static final String HOST = "cdb-msagvqui.cd.tencentcdb.com";
    public static final String PORT = "10032";
    public static final String USER_NAME = "toor";
    public static final String PASSWORD = "toor";
    public static final String DATABASE = "elms";

//    public static final String HOST = env.getProperty("data.backup.host");
//    public static final String PORT = env.getProperty("data.backup.port");
//    public static final String USER_NAME = env.getProperty("spring.datasource.username");
//    public static final String PASSWORD = env.getProperty("spring.datasource.username");
//    public static final String DATABASE = env.getProperty("data.backup.database");
}
